lazy initialization meaning in English
迟缓初始化
缓式初始化
延迟初始化
Examples
- Lazy initialization of memory structures will save cpu time and may defer the activation of other plug - ins
内存结构的滞后初始化可以节省cpu时间并延迟其他插件的激活。 - Instead of double - checked locking , use the initialize - on - demand holder class idiom , which provides lazy initialization , is thread - safe , and is faster and less confusing than double - checked locking
不使用双重检查锁定,而使用initialize - on - demand holder class idiom ,它提供了迟缓初始化,是线程安全的,而且比双重检查锁定更快且没那么混乱: - This idiom derives its thread safety from the fact that operations that are part of class initialization , such as static initializers , are guaranteed to be visible to all threads that use that class , and its lazy initialization from the fact that the inner class is not loaded until some thread references one of its fields or methods
这个idiom由属于类初始化的操作(如静态初始化器)保证对使用这个类的所有线程都是可见的这一事实衍生其线程安全性,内部类直到有线程引用其字段或者方法时才装载这一事实衍生出迟缓初始化。 - In addition to inconsistent synchronization , a number of other detectors for common threading errors are included , such as waiting on a monitor with two locks held which , while not necessarily a bug , could cause a deadlock , using the double - checked locking idiom , incorrect lazy initialization of nonvolatile fields , invoking
除了inconsistent synchronization之外, findbugs还包含其他很多用于检测常见线程错误的检测器,如在加锁两次的情况下等待监视器(这虽然不一定是bug ,但是可能导致死锁) ,使用双检测加锁模式,不正确地初始化非易失性的域,对线程调用